<!-- 默认关注列表 -->
<!Doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>关注</title>
	<meta name="keywords" content="${keywords}"/>
	<meta name="description" content="${description}"/>
    <link rel="shortcut icon" type="image/x-icon" th:href="@{'/static/images/favicon.ico'}" media="screen" />

	<link th:href="@{'/static/css/common.css'}" type="text/css" rel="stylesheet" charset="utf-8">
	<link th:href="@{'/static/css/themify-icons/style.css'}" type="text/css" rel="stylesheet">
	<link th:href="@{'/static/js/layer/skin/default/layer.css'}" type="text/css" rel="stylesheet">
	<script language="javascript" th:src="@{'/static/js/tool.js'}" type="text/javascript"></script>
	<script language="javascript" th:src="@{'/static/js/ajax.js'}" type="text/javascript"></script>
	<script language="javascript" th:src="@{'/static/js/json2.js'}" type="text/javascript"></script>

	<script language="javascript" th:src="@{'/static/js/jquery/jquery.min.js'}" type="text/javascript"></script>
	<script language="javascript" th:src="@{'/static/js/jquery/jquery.letterAvatar.js'}" type="text/javascript"></script>
	<script language="javascript" th:src="@{'/static/js/layer/layer.js'}" type="text/javascript"></script>

</head>
<script type="text/javascript" language="javascript" th:inline="javascript">

//删除关注
function deleteFollow(followId){
	var parameter = "";//URI参数
	parameter += "focusId="+followId;

	if(parameter.indexOf("&") == 0){
		parameter = parameter.substring(1,parameter.length);
	}

	post_request(function(value){
		if(value != ""){
			var returnValue = JSON.parse(value);//JSON转为对象
			for(var key in returnValue){
				if(key == "success"){
					var success = returnValue[key];
					if(success == "true"){
						layer.msg('删除关注成功,1秒后刷新页面',
							{
							  time: 1000 //3秒关闭（如果不配置，默认是3秒）
							},function(){
								//关闭后的操作
					        	document.location.reload();//刷新页面
							}
						);
					}
				}else if(key == "error"){
					var errorValue = returnValue[key];
					var htmlValue = "";
					var i = 0;
					for(var error in errorValue){
						if(error != ""){
							i++;
							htmlValue += "&nbsp;&nbsp;"+i+"、"+errorValue[error]+"<br>";
						}
					}

					layer.open({
					  type: 1,
					  title: '错误',
					  skin: 'layui-layer-rim', //加上边框
					  area: ['300px', '150px'], //宽高
					  content: htmlValue
					});

				}
			}
		}
	},
		"focus/delete?"+ parameter, true);
}
</script>
<body>
<!-- 引入页头 -->
<div th:include="public/newPublic_2"></div>
<div class="skeleton">
	<div class="main wrap backgroundModule" >

		<!-- 引入服务导航 -->
		<div th:include="public/newPublic_4"></div>

		<div class="dataTable">
			<TABLE class="dataList" width="100%">
				<THEAD>
					<TR class="dataThead">
						<TH width="60%">用户</TH>	
						<TH width="20%">关注时间</TH>	
						<TH width="20%">操作</TH>
					</TR>
				</THEAD>
				<TBODY>
					<TR th:if="${resultList.size()>0 and resultList!=null}" th:each="result:${resultList}">
						<TD class="dataTD followModule" style="text-align: left! important;">
							<div class="avatarBox">
								<a th:href="@{'user/control/home?userName='+${result.username}}" target="_blank" class="link">

										<img th:if="${result.avatarName!=null}" th:src="@{'/readImg'+${result.avatarName}}"/>
                                    <!-- 首字符头像-->

                                    <img th:if="${result.avatarName==null}" th:avatar="${result.nikename}"/>


								</a>
							</div>
							<a th:href="@{'user/control/home?userName='+${result.username}}" target="_blank" class="link userName" th:text="'（昵称：'+${result.nikename}+'）'">
							</a>
						</TD>
						<TD class="dataTD" th:text="${#dates.format(result.createTime, 'yyyy-MM-dd HH:mm:ss')}">
						</TD>
						<TD class="dataTD" >
							<a href="javascript:" th:onclick="deleteFollow('[[${result.id}]]')">删除</a>
						</TD>
		    		</TR>

		    			<TR th:if="${total==0}">
							<TD colSpan="3"  class="empty">还没有关注用户</TD>
		    			</TR>
		    	</TBODY>
			</TABLE>
			<DIV class=pageList>
				<div th:include="public/newPublic_1"></div>
			</DIV>
		</div>

	</div>

</div>
<!--引入页脚-->
<div th:include="public/newPublic_3"></div>

</body>

</html>
